* register.el (view-register): Neglect not to avoid failing to
authorJim Blandy <jimb@redhat.com>
Mon, 15 Mar 1993 09:02:00 +0000 (09:02 +0000)
committerJim Blandy <jimb@redhat.com>
Mon, 15 Mar 1993 09:02:00 +0000 (09:02 +0000)
properly display all the possible sorts of things one might find
in a buffer.

lisp/register.el

index 25167cf4abdaf9c7f1ad85a0ec4de89944e38569..447c4c4a595a2bb64f1b212ee5436dc435af5b7b 100644 (file)
@@ -122,23 +122,36 @@ REGISTER is a character."
        (princ "Register ")
        (princ (single-key-description char))
        (princ " contains ")
-       (if (integerp val)
-           (princ val)
-         (if (markerp val)
-             (progn
-               (princ "a buffer position:\nbuffer ")
-               (princ (buffer-name (marker-buffer val)))
-               (princ ", position ")
-               (princ (+ 0 val)))
-           (if (consp val)
-               (progn
-                 (princ "the rectangle:\n")
-                 (while val
-                   (princ (car val))
-                   (terpri)
-                   (setq val (cdr val))))
-             (princ "the string:\n")
-             (princ val))))))))
+       (cond
+        ((integerp val)
+         (princ val))
+
+        ((markerp val)
+         (princ "a buffer position:\nbuffer ")
+         (princ (buffer-name (marker-buffer val)))
+         (princ ", position ")
+         (princ (+ 0 val)))
+
+        ((window-configuration-p val)
+         (princ "a window configuration."))
+
+        ((frame-configuration-p val)
+         (princ "a frame configuration."))
+
+        ((consp val)
+         (princ "the rectangle:\n")
+         (while val
+           (princ (car val))
+           (terpri)
+           (setq val (cdr val))))
+
+        ((stringp val)
+         (princ "the text:\n")
+         (princ val))
+
+        (t
+         (princ "Garbage:\n")
+         (prin1 val)))))))
 
 (defun insert-register (char &optional arg)
   "Insert contents of register REG.  REG is a character.